package top.kaoshanji.p1ch02a;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 代码清单-p1ch02a-01：在Bean里面看看解密之后的内容
 * @author kaoshanji
 * ^_^
 * create time 2025/5/17 19:42
 */
@Slf4j
@Configuration
public class CommandLineRunnerContext {

    @Value("${user.userName}")
    private String userName;

    @Value("${user.passWord}")
    private String passWord;

    @Bean
    public CommandLineRunner commandLineRunner() {
        return (args ) -> {
            log.info("...user.username = {}", userName);
            log.info("...user.password = {}", passWord);
        };
    }

}
